package com.xyz.someapp;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.ProceedingJoinPoint;

@Aspect
public class AroundExample {

    @Around(value="com.xyz.someapp.SystemArchitecture.dataAccessOperation() && args(name,..)",argNames = "name")
    public Object doBasicProfiling(ProceedingJoinPoint pjp,String name) throws Throwable {
        System.out.println("AroundExample doBasicProfiling("+pjp+","+name+")");
        System.out.println("    getThis()="+pjp.getThis());
        System.out.println("    getTarget()="+pjp.getTarget());
        System.out.println("    getKind()="+pjp.getKind());
        System.out.println("    getSignature()="+pjp.getSignature());
        System.out.println("    getArgs()[0]="+pjp.getArgs()[0]);
        Object retVal = pjp.proceed(new Object[] {"YULYA"});
        // stop stopwatch
        return retVal;
    }

}
